home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / cellgame.swf / scripts / frame_2 / PlaceObject2_14_87 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  511 b   |  20 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "seeker")
  3.    {
  4.       if(_root.actions.dead)
  5.       {
  6.          _root.actions.explosion(this);
  7.          removeMovieClip(this);
  8.       }
  9.       _rotation = _rotation + 10;
  10.       deltaX = _X - _root.ship._x;
  11.       deltaY = _Y - _root.ship._y;
  12.       angle = - Math.atan2(deltaX,deltaY);
  13.       ySpeed = speed * Math.cos(angle);
  14.       xSpeed = speed * Math.sin(angle);
  15.       _Y = _Y - ySpeed;
  16.       _X = _X + xSpeed;
  17.       _root.actions.collisions(this);
  18.    }
  19. }
  20.